
package com.mb.ext.core.service;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.mb.ext.core.service.spec.BodyDTO;
import com.mb.ext.core.service.spec.PayOrderSearchDTO;
import com.mb.ext.core.service.spec.UserDTO;
import com.mb.ext.core.service.spec.merchant.MerchantDTO;
import com.mb.ext.core.service.spec.order.PayOrderDTO;
import com.mb.framework.exception.BusinessException;

/**
   * 线下扫码支付接口 - 社区团购系统暂不使用
 * @author 社区团购
 *
 * @param <T>
 */
@Transactional
public interface PayOrderService<T extends BodyDTO>
{

	/**添加线下扫码支付
	 * @param orderDTO
	 * @return
	 * @throws BusinessException
	 */
	String addPayOrder(PayOrderDTO orderDTO) throws BusinessException;
	
	/**根据订单号查询线下扫码订单
	 * @param orderNo - 订单号
	 * @return - 订单
	 * @throws BusinessException
	 */
	PayOrderDTO getPayOrderByOrderNo(String orderNo) throws BusinessException;
	
	/**根据订单id查询线下扫码订单
	 * @param uuid - 订单主键id
	 * @return - 订单
	 * @throws BusinessException
	 */
	PayOrderDTO getPayOrderByUuid(String uuid) throws BusinessException;
	
	/**获取商家所有线下订单
	 * @param merchantDTO - 商家
	 * @return 订单列表
	 * @throws BusinessException
	 */
	List<PayOrderDTO> getPayOrderByMerchant(MerchantDTO merchantDTO) throws BusinessException;
	
	/**获取会员所有线下订单
	 * @param userDTO - 会员
	 * @return 订单列表
	 * @throws BusinessException
	 */
	List<PayOrderDTO> getPayOrderByUser(UserDTO userDTO) throws BusinessException;
	
	/**线下支付完成
	 * @param orderDTO - 订单
	 * @throws BusinessException
	 */
	void completePayOrderPay(PayOrderDTO orderDTO) throws BusinessException;
	
	/**线下订单完成后领取积分
	 * @param orderDTO - 订单
	 * @throws BusinessException
	 */
	void receivePayOrderPoint(PayOrderDTO orderDTO) throws BusinessException;
	
	/**根据条件查询线下订单
	 * @param searchDTO - 查询条件
	 * @return 订单列表
	 * @throws BusinessException
	 */
	List<PayOrderDTO> searchPayOrder(PayOrderSearchDTO searchDTO) throws BusinessException;
	
	/**根据条件查询线下订单数量
	 * @param searchDTO - 查询条件
	 * @return订单数量
	 * @throws BusinessException
	 */
	int searchPayOrderTotal(PayOrderSearchDTO searchDTO) throws BusinessException;
	
	/**根据条件查询平台分账金额
	 * @param searchDTO - 查询条件
	 * @return 金额
	 * @throws BusinessException
	 */
	BigDecimal getAsinfoPlatformTotal(PayOrderSearchDTO searchDTO) throws BusinessException;
	
	/**根据条件查询商家分账金额
	 * @param searchDTO - 查询条件
	 * @return 金额
	 * @throws BusinessException
	 */
	BigDecimal getAsinfoMerchantTotal(PayOrderSearchDTO searchDTO) throws BusinessException;
}
